package com.zhb.cloud.mybatis.sys.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Email;
import lombok.Data;

@Data
@Entity
@Table(name = "s_user")
public class User implements Serializable {
	private static final long serialVersionUID = -3808765596272151536L;
	@Id
	@GeneratedValue(generator = "uuid")
	@GenericGenerator(strategy = "uuid", name = "uuid")
	private String id;
	@Email(regexp = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$", message = "邮箱格式不正确")
	@Column(name = "email", nullable = false)
	private String email;
	@Column(name = "password", length = 60, nullable = false)
	private String password;
	@Column(name = "user_name", unique = true, length = 60, nullable = false)
	private String userName;
	@Column(name = "phone", unique = true, length = 11, nullable = false)
	private String phone;
	@Column(name = "real_name", length = 60, nullable = false)
	private String realName;
	@Column(name = "register_time", nullable = false)
	private Date registerTime;
	@Column(name = "gender", nullable = false)
	private Integer gender;
	@Column(name = "address", nullable = false)
	private String address;
}